#include <interface\barSelector.h>
#include <interface\fieldSet.h>
#include <interface\gl.h>

barSelectorCursor::barSelectorCursor(barSelector* bar): abstractBarCursor(bar){
    ELname = "<barSelectorCursor>";
}
barSelectorCursor::barSelectorCursor(barSelector* bar,window* win): abstractBarCursor(bar, win){
    ELname = "<barSelectorCursor>";
}
barSelectorCursor::~barSelectorCursor(){}

barSelector::barSelector(): abstractSlideBar(sBar_horizontal){
    setCursor( new barSelectorCursor(this) );
    ELname = "<barSelector>";
}
barSelector::barSelector(window* win):  abstractSlideBar(sBar_horizontal, win){
    setCursor( new barSelectorCursor(this, win) );
    ELname = "<barSelector>";
}
barSelector::~barSelector(){}

void barSelector::display(){
    if( !styleS ) return;
    abstractSlideBar::display();
    int pOffX = 0;
    int pOffY = 0;
    getOffset( &pOffX, &pOffY );
    glColor(bkgColFromSS(elm_barSelector));
    glDrawRect(enc,pOffX,pOffY);
    cursor->display();
}

void barSelectorCursor::display(){
    if( !styleS ) return;
    abstractBarCursor::display();
    int pOffX = 0;
    int pOffY = 0;
    getOffset( &pOffX, &pOffY );
    glColor(bkgColFromSS(elm_barSelCursor));
    glDrawRect(enc,pOffX,pOffY);
}
